/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import doan.quanlycanbo.portlet.model.quatrinhdinuocngoai;
import doan.quanlycanbo.portlet.model.quatrinhdinuocngoaiModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the quatrinhdinuocngoai service. Represents a row in the &quot;quatrinhdinuocngoai&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link doan.quanlycanbo.portlet.model.quatrinhdinuocngoaiModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link quatrinhdinuocngoaiImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a quatrinhdinuocngoai model instance should use the {@link doan.quanlycanbo.portlet.model.quatrinhdinuocngoai} interface instead.
 * </p>
 *
 * @author Nguyen Tuan Vinh
 * @see quatrinhdinuocngoaiImpl
 * @see doan.quanlycanbo.portlet.model.quatrinhdinuocngoai
 * @see doan.quanlycanbo.portlet.model.quatrinhdinuocngoaiModel
 * @generated
 */
public class quatrinhdinuocngoaiModelImpl extends BaseModelImpl<quatrinhdinuocngoai>
	implements quatrinhdinuocngoaiModel {
	public static final String TABLE_NAME = "quatrinhdinuocngoai";
	public static final Object[][] TABLE_COLUMNS = {
			{ "maquatrinhdnn", new Integer(Types.BIGINT) },
			{ "groupId", new Integer(Types.BIGINT) },
			{ "companyId", new Integer(Types.BIGINT) },
			{ "languageId", new Integer(Types.VARCHAR) },
			{ "mahoso", new Integer(Types.BIGINT) },
			{ "tungay", new Integer(Types.TIMESTAMP) },
			{ "denngay", new Integer(Types.TIMESTAMP) },
			{ "quocgia", new Integer(Types.VARCHAR) },
			{ "mucdich", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table quatrinhdinuocngoai (maquatrinhdnn LONG not null primary key,groupId LONG,companyId LONG,languageId VARCHAR(75) null,mahoso LONG,tungay DATE null,denngay DATE null,quocgia VARCHAR(75) null,mucdich VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table quatrinhdinuocngoai";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.doan.quanlycanbo.portlet.model.quatrinhdinuocngoai"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.doan.quanlycanbo.portlet.model.quatrinhdinuocngoai"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.doan.quanlycanbo.portlet.model.quatrinhdinuocngoai"));

	public quatrinhdinuocngoaiModelImpl() {
	}

	public long getPrimaryKey() {
		return _maquatrinhdnn;
	}

	public void setPrimaryKey(long pk) {
		setMaquatrinhdnn(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_maquatrinhdnn);
	}

	public long getMaquatrinhdnn() {
		return _maquatrinhdnn;
	}

	public void setMaquatrinhdnn(long maquatrinhdnn) {
		_maquatrinhdnn = maquatrinhdnn;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public String getLanguageId() {
		if (_languageId == null) {
			return StringPool.BLANK;
		}
		else {
			return _languageId;
		}
	}

	public void setLanguageId(String languageId) {
		_languageId = languageId;
	}

	public long getMahoso() {
		return _mahoso;
	}

	public void setMahoso(long mahoso) {
		_mahoso = mahoso;
	}

	public Date getTungay() {
		return _tungay;
	}

	public void setTungay(Date tungay) {
		_tungay = tungay;
	}

	public Date getDenngay() {
		return _denngay;
	}

	public void setDenngay(Date denngay) {
		_denngay = denngay;
	}

	public String getQuocgia() {
		if (_quocgia == null) {
			return StringPool.BLANK;
		}
		else {
			return _quocgia;
		}
	}

	public void setQuocgia(String quocgia) {
		_quocgia = quocgia;
	}

	public String getMucdich() {
		if (_mucdich == null) {
			return StringPool.BLANK;
		}
		else {
			return _mucdich;
		}
	}

	public void setMucdich(String mucdich) {
		_mucdich = mucdich;
	}

	public quatrinhdinuocngoai toEscapedModel() {
		if (isEscapedModel()) {
			return (quatrinhdinuocngoai)this;
		}
		else {
			return (quatrinhdinuocngoai)Proxy.newProxyInstance(quatrinhdinuocngoai.class.getClassLoader(),
				new Class[] { quatrinhdinuocngoai.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
					quatrinhdinuocngoai.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		quatrinhdinuocngoaiImpl quatrinhdinuocngoaiImpl = new quatrinhdinuocngoaiImpl();

		quatrinhdinuocngoaiImpl.setMaquatrinhdnn(getMaquatrinhdnn());

		quatrinhdinuocngoaiImpl.setGroupId(getGroupId());

		quatrinhdinuocngoaiImpl.setCompanyId(getCompanyId());

		quatrinhdinuocngoaiImpl.setLanguageId(getLanguageId());

		quatrinhdinuocngoaiImpl.setMahoso(getMahoso());

		quatrinhdinuocngoaiImpl.setTungay(getTungay());

		quatrinhdinuocngoaiImpl.setDenngay(getDenngay());

		quatrinhdinuocngoaiImpl.setQuocgia(getQuocgia());

		quatrinhdinuocngoaiImpl.setMucdich(getMucdich());

		return quatrinhdinuocngoaiImpl;
	}

	public int compareTo(quatrinhdinuocngoai quatrinhdinuocngoai) {
		long pk = quatrinhdinuocngoai.getPrimaryKey();

		if (getPrimaryKey() < pk) {
			return -1;
		}
		else if (getPrimaryKey() > pk) {
			return 1;
		}
		else {
			return 0;
		}
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		quatrinhdinuocngoai quatrinhdinuocngoai = null;

		try {
			quatrinhdinuocngoai = (quatrinhdinuocngoai)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = quatrinhdinuocngoai.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(19);

		sb.append("{maquatrinhdnn=");
		sb.append(getMaquatrinhdnn());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", languageId=");
		sb.append(getLanguageId());
		sb.append(", mahoso=");
		sb.append(getMahoso());
		sb.append(", tungay=");
		sb.append(getTungay());
		sb.append(", denngay=");
		sb.append(getDenngay());
		sb.append(", quocgia=");
		sb.append(getQuocgia());
		sb.append(", mucdich=");
		sb.append(getMucdich());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(31);

		sb.append("<model><model-name>");
		sb.append("doan.quanlycanbo.portlet.model.quatrinhdinuocngoai");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>maquatrinhdnn</column-name><column-value><![CDATA[");
		sb.append(getMaquatrinhdnn());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>languageId</column-name><column-value><![CDATA[");
		sb.append(getLanguageId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mahoso</column-name><column-value><![CDATA[");
		sb.append(getMahoso());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>tungay</column-name><column-value><![CDATA[");
		sb.append(getTungay());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>denngay</column-name><column-value><![CDATA[");
		sb.append(getDenngay());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>quocgia</column-name><column-value><![CDATA[");
		sb.append(getQuocgia());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>mucdich</column-name><column-value><![CDATA[");
		sb.append(getMucdich());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _maquatrinhdnn;
	private long _groupId;
	private long _companyId;
	private String _languageId;
	private long _mahoso;
	private Date _tungay;
	private Date _denngay;
	private String _quocgia;
	private String _mucdich;
	private transient ExpandoBridge _expandoBridge;
}